IF OBJECT_ID('ssf.ptx_print_message') IS NOT NULL
	DROP PROCEDURE ssf.ptx_print_message
GO

CREATE PROCEDURE ssf.ptx_print_message
	@message NVARCHAR(2048) = NULL
	, @delay TIME(3) = NULL
AS
/*
<object_header>

<object_summary>
	<purpose><![CDATA[
Just print a message.
	]]></purpose>
</object_summary>

</object_header>
*/

-- ============
/*<code_comment><![CDATA[if delay has a value, wait]]></code_comment>*/
IF @delay IS NOT NULL
BEGIN
	DECLARE @delay_string VARCHAR(12) = CAST(@delay AS VARCHAR(12))
	WAITFOR DELAY @delay_string
END
-- ============

-- ============
/*<code_comment><![CDATA[print message if not null]]></code_comment>*/
IF NULLIF(@message, N'') IS NOT NULL
	PRINT(@message)
-- ============

RETURN @@ERROR
GO
